package org.smarthings.things.automation.rest.resources;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.smarthings.things.commons.rest.IdentifiableResource;

@XmlType(name = "rule")
@XmlRootElement(name = "rule")
public class RuleResource extends IdentifiableResource {

	private TriggerResource trigger;
	private ConditionResource condition;
	private ActionResource action;
	private boolean active;

	@XmlElement(name = "trigger", required = true)
	public TriggerResource getTrigger() {
		return trigger;
	}

	public void setTrigger(TriggerResource trigger) {
		this.trigger = trigger;
	}

	@XmlElement(name = "condition", required = false)
	public ConditionResource getCondition() {
		return condition;
	}

	public void setCondition(ConditionResource condition) {
		this.condition = condition;
	}

	@XmlElement(name = "action", required = true)
	public ActionResource getAction() {
		return action;
	}

	public void setAction(ActionResource action) {
		this.action = action;
	}

	@XmlElement(name = "active", required = false)
	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

}
